package com.ruoyi.project.service.impl;

import java.util.List;

import com.ruoyi.common.datascope.annotation.DataScope;
import com.ruoyi.project.domain.CxcyContract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.CxcyContractMapper;
import com.ruoyi.project.service.ICxcyContractService;

/**
 * 合同信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-10
 */
@Service
public class CxcyContractServiceImpl implements ICxcyContractService 
{
    @Autowired
    private CxcyContractMapper cxcyContractMapper;

    /**
     * 查询合同信息
     * 
     * @param id 合同信息主键
     * @return 合同信息
     */
    @Override
    public CxcyContract selectCxcyContractById(Long id)
    {
        return cxcyContractMapper.selectCxcyContractById(id);
    }

    /**
     * 查询合同信息列表
     * 
     * @param cxcyContract 合同信息
     * @return 合同信息
     */
    @Override
    @DataScope(deptAlias = "cxcy_contract", userAlias = "cxcy_contract")
    public List<CxcyContract> selectCxcyContractList(CxcyContract cxcyContract)
    {
        return cxcyContractMapper.selectCxcyContractList(cxcyContract);
    }

    /**
     * 新增合同信息
     * 
     * @param cxcyContract 合同信息
     * @return 结果
     */
    @Override
    public int insertCxcyContract(CxcyContract cxcyContract)
    {
        return cxcyContractMapper.insertCxcyContract(cxcyContract);
    }

    /**
     * 修改合同信息
     * 
     * @param cxcyContract 合同信息
     * @return 结果
     */
    @Override
    public int updateCxcyContract(CxcyContract cxcyContract)
    {
        return cxcyContractMapper.updateCxcyContract(cxcyContract);
    }

    /**
     * 批量删除合同信息
     * 
     * @param ids 需要删除的合同信息主键
     * @return 结果
     */
    @Override
    public int deleteCxcyContractByIds(Long[] ids)
    {
        return cxcyContractMapper.deleteCxcyContractByIds(ids);
    }

    /**
     * 删除合同信息信息
     * 
     * @param id 合同信息主键
     * @return 结果
     */
    @Override
    public int deleteCxcyContractById(Long id)
    {
        return cxcyContractMapper.deleteCxcyContractById(id);
    }
}
